package cn.edu.cqut.mdm.container;

import java.util.HashMap;
import java.util.Map;

import cn.edu.cqut.mdm.core.module.RemoteModuleEntity;

public class NetworkPublishedModuleContainer {
	private static NetworkPublishedModuleContainer instance = new NetworkPublishedModuleContainer();
	private Map<String, RemoteModuleEntity> modules = new HashMap<String, RemoteModuleEntity>();
	
	private NetworkPublishedModuleContainer(){
	}
	
	public static NetworkPublishedModuleContainer getInstance(){
		return instance;
	}
	
	public void addModule(RemoteModuleEntity module) {
		this.modules.put(module.getUid(), module);
	}
	public RemoteModuleEntity getModule(String uid) {
		return this.modules.get(uid);
	}
	public void delModule(String uid) {
		this.modules.remove(uid);
	}
	public Map<String, RemoteModuleEntity> getAllModuleMap() {
		return this.modules;
	}
}
